import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import About from '../views/About.vue'
import Book from '../views/Book.vue'
import App from '../App.vue'
import BookAll from '../views/BookAll.vue'
import AddBook from '../views/AddBook.vue'
import Index from '../views/index.vue'
import BookUpdate from '../views/BookUpdate.vue'

Vue.use(VueRouter)

const routes = [
	{
		path:'/',
		redirect:'/bookAll',
		name:'图书管理',
		component:Index,
		show:true,
		children:[
			{path:'/bookAll',name:'查询图书',component:BookAll},
			{path:'/addBook',name:'添加图书',component:AddBook}
		]
	},
	{
		path:'/bookUpdate',
		show:false,
		// path:'/bookUpdate/:id',
		component:BookUpdate
	}
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
